<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../../common/assets_header.jsp"/>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<script type="text/javascript">
jQuery(document).ready(function() {    
});

	function check() {
		document.getElementById('ok').disabled = 'disabled';
	}
	
	function backclientlist(){
	$("#clientform").attr("action","<%=request.getContextPath()%>/sso/client_details/list");
	$("#clientform").submit();
	}
</script>
</head>
<body >
<!-- content -->
		<div class="page-content">
			
		<div class="page-header">
				<h1>
					<c:if test="${oauthClientDetails.oauthClientDetailsId==null }">添加应用配置</c:if>
						<c:if test="${oauthClientDetails.oauthClientDetailsId!=null }">编辑应用配置</c:if>
								<small>
									<i class="icon-double-angle-right"></i>
									
								</small>
							</h1>
							
					
			</div>
				<!-- END PAGE HEADER-->
				<div class="row">
					<c:if test="${success}">
						<div class="alert alert-success">
									<button class="close" data-dismiss="alert"></button>
									<strong><spring:message code="success"></spring:message>!</strong> <spring:message code="save success"></spring:message>！
								</div>
					</c:if>
					
					<c:if test="${success==false}">
						<div class="alert alert-failure">
									<button class="close" data-dismiss="alert"></button>
									<strong><spring:message code="failure"></spring:message>!</strong> ${message}
								</div>
					</c:if>
				
					<div class="col-xs-12">
	<%-- 	<div class="page-content">

			<div class="container-fluid">

				<div class="row-fluid">

					<div class="span12">


						<h3 class="page-title">

							<small></small>

						</h3>

						<ul class="breadcrumb">

							<li><i class="icon-home"></i> <a href="index.html">Home</a>

								<i class="icon-angle-right"></i></li>

							<li><a href="#">单点登录系统</a> <i class="icon-angle-right"></i></li>

							<li><a href="#">应用配置</a></li>

						</ul>
					</div>
				</div>

				<div class="portlet-body form">
					<c:if test="${success==false}">
						<div class="alert alert-failure">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="failure"></spring:message>!</strong>
							${errorMsg}
						</div>
					</c:if>
					<c:if test="${success }">
						<div class="alert alert-success">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="success"></spring:message>!</strong>
							<spring:message code="save success"></spring:message>
							!
						</div>
					</c:if>

					<h3 class="page-title">
						<c:if test="${oauthClientDetails.oauthClientDetailsId==null }">
							添加应用配置
						</c:if>
						<c:if test="${oauthClientDetails.oauthClientDetailsId!=null }">
							编辑应用配置
						</c:if>
					</h3>
 --%>
					<form
						action="<c:if test="${oauthClientDetails.oauthClientDetailsId==null}">add</c:if>
				<c:if test="${oauthClientDetails.oauthClientDetailsId!=null}">edit</c:if>"
						method="post" class="form-horizontal" id="clientform"
						onsubmit="return check();">
						<input type="hidden" name="searchValue" value="${searchValue}" />
						<input type="hidden" name="id"
							value="${oauthClientDetails.oauthClientDetailsId}"></input> <input
							type="hidden" name="token" value="${token}"></input>

					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1">clientId：</label>
							<div class="controls">

								<input type="text" maxLength="30"
									<c:if test="${oauthClientDetails.oauthClientDetailsId!=null}">disabled="disabled"</c:if>
									name="clientId" value="${oauthClientDetails.clientId }"
									class="m-wrap" required />
								<c:if test="${oauthClientDetails.oauthClientDetailsId!=null}">

									<input type="hidden" name="clientId"
										value="${oauthClientDetails.clientId }"></input>
								</c:if>

								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">clientSecret：</label>
								<div class="controls">
									<input type="text" maxlength="200" name="clientSecret"
									value="${oauthClientDetails.clientSecret}" class="m-wrap"
									required /> <span class="help-inline"></span>
								</div>

						</div>

						<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">resourceIds：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="resourceIds"
									value="${oauthClientDetails.resourceIds}" class="m-wrap"
									required /> <span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">scope：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="scope"
									value="${oauthClientDetails.scope}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">webServerRedirectUri：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="webServerRedirectUri"
									value="${oauthClientDetails.webServerRedirectUri}"
									class="m-wrap" required /> <span class="help-inline"></span>

							</div>

						</div>

						<div class="form-actions center">

							<button type="submit" id="ok" class="btn btn-xs btn-primary">
								<spring:message code="btn.common.save"></spring:message>
							</button>
							<button type="button" onclick="backclientlist();" class="btn btn-xs btn-primary">
								<spring:message code="btn.common.back"></spring:message>
							</button>

						</div>

					</form>

				</div>


			</div>
			
		</div>
</body>
</html>